<title>会员管理</title>

<div class="layui-card layadmin-header">
    <div class="layui-breadcrumb" lay-filter="breadcrumb">
        <a lay-href="">主页</a>
        <a><cite>会员</cite></a>
        <a><cite>会员管理</cite></a>
    </div>
</div>

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-form layui-card-header layuiadmin-card-header-auto" lay-filter="layadmin-useradmin-formlist">
            <div class="layui-form-item">

                <div class="layui-inline">
                    <label class="layui-form-label">手机号</label>
                    <div class="layui-input-block">
                        <input type="text" id="telPhone" name="telPhone" placeholder="请输入手机号" autocomplete="off" class="layui-input">
                    </div>
                </div>

                <div class="layui-inline">
                    <label class="layui-form-label">vip开启时间</label>
                    <div class="layui-input-inline">
                        <label for="startTime">
                            <input type="text" class="layui-input" name="startTime" id="startTime" placeholder="开始时间">
                        </label>
                    </div>
                </div>
                <div class="layui-inline">
                    <div class="layui-input-inline">
                        <label for="endTime">
                            <input type="text" class="layui-input" name="endTime" id="endTime" placeholder="结束时间">
                        </label>
                    </div>
                </div>

                <div class="layui-inline">
                    <button class="layui-btn layuiadmin-btn-admin" lay-submit lay-filter="LAY-vips-back-search">
                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                    </button>
                </div>
            </div>
        </div>

        <div class="layui-card-body">

            <table id="LAY-vips-back-manage" lay-filter="LAY-vips-back-manage"></table>
            <script type="text/html" id="table-vipsadmin-admin">
                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
            </script>
        </div>
    </div>
</div>

<script>
    layui.use('useradmin', layui.factory('useradmin')).use(['admin', 'useradmin', 'table'], function(){
        var $ = layui.$
            ,admin = layui.admin
            ,view = layui.view
            ,table = layui.table
            ,form = layui.form;

        form.render(null, 'layadmin-useradmin-formlist');

        //监听搜索
        form.on('submit(LAY-vips-back-search)', function(data){
            var field = data.field;
            console.log(field);
            var startTime = field.startTime;
            var endTime = field.endTime;
            var telPhone = field.telPhone;
            console.log(startTime);
            //执行重载
            table.reload('LAY-vips-back-manage', {
                url:'/backstage/vipsShow',
                where: {
                    startTime:startTime,
                    endTime:endTime,
                    phone:telPhone
                },page: {
                    curr:1
                }
            });
        });

        $('.layui-btn.layuiadmin-btn-admin').on('click', function(){
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });
    });
</script>
<script>
    layui.use('laydate', function() {
        var laydate = layui.laydate;
        /*加载日历*/
        laydate.render({
            elem: '#startTime'
            ,type: 'datetime'
        });
        laydate.render({
            elem: '#endTime'
            ,type: 'datetime'
        });
    });
</script>